'use strict'

module.exports = app => {
	const { STRING, INTEGER, DATE } = app.Sequelize

	const InvitationCode = app.model.define('invitationCode', {
		id: { type: INTEGER, primaryKey: true, autoIncrement: true },
		code: {
			type: STRING(12),
			field: '_code',
			comment: '邀请码',
		},
		status: {
			type: INTEGER,
			field: '_status',
			comment: '使用状态 0未使用 1使用',
		},
		createdAt: DATE,
		updatedAt: DATE,
	})

	return InvitationCode
}
